//
//  SYAttendLectureTableViewCell.m
//  SanYiTeaching
//
//  Created by 郑浩然 on 2019/4/22.
//  Copyright © 2019年 SanYi. All rights reserved.
//

#import "SYAttendLectureTableViewCell.h"

@interface SYAttendLectureTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *timeLab;
@property (weak, nonatomic) IBOutlet UILabel *numberLab;
@property (weak, nonatomic) IBOutlet UIView *bgView;

@property (weak, nonatomic) IBOutlet UIButton *jiluBtn;//记录
@property (weak, nonatomic) IBOutlet UIImageView *bofangImage;//播放按钮
@property (weak, nonatomic) IBOutlet UIButton *xindeBtn;//心得
@property (weak, nonatomic) IBOutlet UILabel *xindeNumberLab;

@end


@implementation SYAttendLectureTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)attendLectureTableViewCellIndexPath:(NSIndexPath *)indexPath stusa:(NSInteger)stusa {
    if (indexPath.row %2) {
        self.bgView.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
        
    } else {
        self.bgView.backgroundColor = [UIColor whiteColor];
    }
    if (stusa == 2) {
        self.bofangImage.hidden = NO;
//        self.numberLab.hidden = YES;
        self.jiluBtn.hidden = YES;
        self.xindeBtn.hidden = YES;
        _nameLab.text = @"新概念1";
        _timeLab.text = @"日期：2019-03-20 19：20：08";
        
    } else {
        self.bofangImage.hidden = YES;
        self.jiluBtn.hidden = NO;
        self.xindeBtn.hidden = NO;
        _nameLab.text = @"新概念1";
        _timeLab.text = @"听课日期：2019-03-20 19：20：08";
        [self.jiluBtn setTitle:@"听课记录：3" forState:UIControlStateNormal];
        [self.xindeBtn setTitle:@"听课心得：3" forState:UIControlStateNormal];
    }
    
}
//听课记录
- (IBAction)tingkeBtnClick:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(attendLectureTableType:)]) {
        [self.delegate attendLectureTableType:SYDetailsTypeJiLu];
    }
}
//听课心得
- (IBAction)xinDeBtnClick:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(attendLectureTableType:)]) {
        [self.delegate attendLectureTableType:SYDetailsTypeXinDe];
    }
}

- (void)setNameStr:(NSString *)nameStr {
    self.bofangImage.hidden = YES;
    self.jiluBtn.hidden = YES;
    self.xindeBtn.hidden = YES;
    self.xindeNumberLab.hidden = NO;
    _nameLab.text = @"新概念1";
    _timeLab.text = @"申请日期：2019-03-20 19：20：08";
    _xindeNumberLab.text = @"数量：2";
    _nameLab.textColor = [UIColor colorWithHexString:@"#20B097"];
    _timeLab.textColor = [UIColor colorWithHexString:@"#20B097"];
    
}
- (void)attendLectureTableDetailsType:(SYDetailsType)type {
    self.bofangImage.hidden = YES;
    self.jiluBtn.hidden = YES;
    self.xindeBtn.hidden = YES;
    self.xindeNumberLab.hidden = NO;
    _nameLab.text = @"新概念1";
    _timeLab.text = @"申请日期：2019-03-20 19：20：08";
    if (type == SYDetailsTypeZiYuanXind) {//资源心得
        _xindeNumberLab.text = @"数量：2";
    } else if (type == SYDetailsTypeJiLu) {//听课心得
        _xindeNumberLab.text = @"次数：2";
    }
    
    _nameLab.textColor = [UIColor colorWithHexString:@"#20B097"];
    _timeLab.textColor = [UIColor colorWithHexString:@"#20B097"];
}


@end



















